import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*

testCase="DBshop020_商品管理商品属性删除属性"
firefox=openBrowser(urlAdmin) #调用自定义函数打开网页,url的值是在testData文件中定义的
#调用自定义函数进行后台的登录
DBshopLoginAdmin(firefox)
# 依次点击"商品管理","商品属性","属性"
DBshopEnterMenu3(firefox,"商品管理","商品属性","属性")
# 点击删除
firefox.find_element_by_xpath("//td[contains(.,'好好学习')]/following-sibling::td[3]/a[3]").click()
firefox.switch_to_alert()


time.sleep(3)
# 断言：
try:
    firefox.find_element_by_xpath("//td[contains(.,'好好学习')]")
    writeLog("%s 测试失败" % testCase)
except:
    writeLog("%s 测试通过" % testCase)
    getPhoto(firefox)
firefox.quit()